<template>
  <div class="user-card">
    <div class="icon-logo">
      <PreviewImg
        :src="nowRowData.organizationLogo || nowRowData.doorHeadImgs"
      ></PreviewImg>
      <div class="vr-btn fc" v-show="nowRowData.vr_src" @click="handleShowVR">
        VR
      </div>
    </div>
    <div class="user-info">
      <p class="f-between">
        <span>联系人：{{ nowRowData.legalUserName || "--" }}</span>
        <span class="text-tag fc">{{ nowRowData.organizationLevelLabel }}</span>
      </p>
      <p>
        <span>联系电话：{{ nowRowData.legalUserPhone || "--" }}</span>
      </p>
      <p>
        <span>地址：{{ nowRowData.organizationAddress || "--" }}</span>
      </p>
    </div>
    <!-- <ul class="nav-list">
      <li class="nav-list-item" v-for="(item, index) in orgSList" :key="index">
        <img :src="item.icon" class="icon-img" alt="" />
        <div class="item-content">
          <p class="text-label">{{ item.label }}</p>
          <p class="text-value" :style="{color:item.color}">{{ item.value }}</p>
        </div>
      </li>
    </ul> -->
    <AplidDialog
      style="
        --dialog-background: #fff;
        --dialog-header-background: rgba(253, 189, 0, 1);
      "
      width="75%"
      v-model="visible"
      :title="nowRowData.organizationName || nowRowData.soleValue"
    >
      <iframe
        v-if="visible"
        :src="nowRowData.vr_src"
        style="width: 100%; height: 60vh"
        frameborder="0"
      ></iframe>
    </AplidDialog>
  </div>
</template>

<script setup lang="ts">
import { getAssetsFile } from "@/utils/index";

const props = defineProps<{
  nowRowData?: any;
}>();

const visible = ref(false);

const orgSList = [
  {
    label: "床位总数",
    value: props.nowRowData.bedTotalNum | 0,
    icon: getAssetsFile("icon-hom1/icon-5.webp"),
    color: "rgba(22, 200, 255, 1)",
  },
  {
    label: "入住总数",
    value: "70",
    icon: getAssetsFile("icon-hom1/icon-6.webp"),
    color: "rgba(22, 200, 255, 1)",
  },
  {
    label: "入住率",
    value: "50%",
    icon: getAssetsFile("icon-hom1/icon-7.webp"),
    color: "rgba(253, 189, 0, 1)",
  },
];

const handleShowVR = () => {
  visible.value = true;
};
</script>

<style scoped lang="scss">
.user-card {
  .icon-logo {
    width: calc(100% - 20px);
    height: 94.82px;
    margin: 10px;
    background-color: rgba(255, 255, 255, 0.709);
    position: relative;
    img {
      width: 100%;
      height: 100%;
    }
    .vr-btn {
      position: absolute;
      bottom: 0;
      left: 0;
      font-family: "Microsoft YaHei Bold";
      font-weight: 700;
      font-size: 14px;
      letter-spacing: 0.05px;
      line-height: 30px;
      color: #fff;
      text-shadow: 0 2px 3px rgba(0, 0, 0, 0.51);
      border-radius: 0 5px 0 0;
      background: #fdbd00;
      width: 31.07px;
      height: 19px;
      &:hover {
        cursor: pointer;
      }
    }
  }
  .user-info {
    padding: 10px;
    color: #fff;
    font-family: "Microsoft YaHei";
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.05px;
    text-align: left;
    line-height: 20px;
    .text-tag {
      background-color: rgba(253, 189, 0, 0.1);
      color: rgba(253, 189, 0, 1);
      border-radius: 2px;
      height: 19px;
      width: 39.07px;
      font-family: "Microsoft YaHei";
      font-weight: 400;
      font-size: 10px;
      letter-spacing: 0.05px;
    }
  }
  .nav-list {
    display: flex;
    align-items: center;
    margin: 10px;
    border-top: 1px dashed #ffffff90;
    padding-top: 10px;
    &-item {
      flex: 1;
      display: flex;
      gap: 6px;
      .icon-img {
        width: 29.66px;
        height: 29.66px;
        background: transparent;
      }
      .item-content {
        .text-label {
          font-family: "Microsoft YaHei";
          font-weight: 400;
          font-size: 10px;
          letter-spacing: 0.05px;
          color: #fff;
        }
        .text-value {
          font-family: "MS PGothic";
          font-weight: 400;
          font-size: 16px;
          color: #16c8ff;
          text-shadow: 0 3px 6px rgba(22, 200, 255, 0.33);
        }
      }
    }
  }
}
</style>
